package com.isunland.managesystem.adapter;

import android.support.annotation.NonNull;
import android.view.View;
import android.widget.TextView;
import butterknife.BindView;
import com.isunland.managesystem.R;
import com.isunland.managesystem.base.BaseButterKnifeAdapter;
import com.isunland.managesystem.base.BaseVolleyActivity;
import com.isunland.managesystem.entity.AttendanceSummaryQuery;
import com.isunland.managesystem.utils.MyStringUtil;
import com.isunland.managesystem.utils.MyUtils;
import java.util.ArrayList;

/**
 * 对象功能:
 * 开发公司: 北京信普达系统工程有限公司
 * 开发人员: wangyanan
 * 创建时间: 2017/4/5 15:01
 */

public class AttendanceSummaryQueryListAdapter
    extends BaseButterKnifeAdapter<AttendanceSummaryQuery> {

  @SuppressWarnings("unused") public AttendanceSummaryQueryListAdapter(BaseVolleyActivity context,
      ArrayList<AttendanceSummaryQuery> objects) {
    super(context, objects);
  }

  @Override protected int setLayoutId() {
    return R.layout.adapter_attendance_query;
  }

  @NonNull @Override protected BaseViewHolder initHolder(View convertView) {
    return new ViewHolder(convertView);
  }

  @Override
  protected void initView(AttendanceSummaryQuery item, BaseViewHolder baseHolder, int position) {
    ViewHolder holder = (ViewHolder) baseHolder;
    MyUtils.switchShadowStutus(context, holder.mContentStatusTv, item.getDATA_STATUS());
    holder.mContentTwoTv.setText(item.getCOMMFIELD_CONTENT());//表单详情
    holder.tvApplyTime.setText(item.getCOMMFIELD_DATE());
    holder.mContentThreeTv.setText(item.getREG_DATE());//时间
    holder.mTypeTv.setText(item.getRECORDTYPE());
    holder.mPersonNameTv.setText(
        MyStringUtil.connect(MyStringUtil.SEPEREATE, item.getREG_STAFF_NAME(),
            MyStringUtil.SEPEREATE, item.getHOURS(), "小时"));
  }

  @Override public boolean isEmpty() {
    return false;
  }

  protected class ViewHolder extends BaseViewHolder {
    //@BindView(R.id.tv_contentOne_simpleList) TextView tvContentOneSimpleList;
    //@BindView(R.id.ll_holderOne_simpleList) LinearLayout llHolderOneSimpleList;
    //@BindView(R.id.tv_TitleTwo_simpleList) TextView tvTitleTwoSimpleList;
    //@BindView(R.id.ll_holderTwo_simpleList) LinearLayout llHolderTwoSimpleList;
    //@BindView(R.id.tv_contentFour_simpleList) TextView tvContentFourSimpleList;
    //@BindView(R.id.tv_contentFive_simpleList) TextView tvContentFiveSimpleList;
    //@BindView(R.id.tv_contentSix_simpleList) TextView tvContentSixSimpleList;
    //@BindView(R.id.tv_contentSeven_simpleList) TextView tvContentSevenSimpleList;
    //@BindView(R.id.tv_contentEight_simpleList) TextView tvContentEightSimpleList;
    //@BindView(R.id.ll_holderThree_simpleList) LinearLayout llHolderThreeSimpleList;
    @BindView(R.id.ll_planStatus) TextView mContentStatusTv;
    @BindView(R.id.tv_contentTwo_simpleList) TextView mContentTwoTv;
    @BindView(R.id.tv_contentThree_simpleList) TextView mContentThreeTv;
    @BindView(R.id.tv_type) TextView mTypeTv;
    @BindView(R.id.tv_person_name) TextView mPersonNameTv;
    //@BindView(R.id.tv_person_data) TextView mPersonDataTv;
    @BindView(R.id.tv_applyTime) TextView tvApplyTime;

    ViewHolder(View view) {
      super(view);
    }
  }
}
